# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
import shutil
from cerbero.utils import shell


class Recipe(recipe.Recipe):
    name = 'gas-preprocessor'
    version = '0.0.0'
    licenses = [License.GPLv2]
    btype = BuildType.CUSTOM
    remotes = {'origin': 'git://git.libav.org/gas-preprocessor.git'}
    commit = 'fad9080da871bb7924431a5e22fdaccae56b5950'

    def install(self):
        if not os.path.exists(os.path.join(self.config.prefix, 'bin')):
            os.makedirs(os.path.join(self.config.prefix, 'bin'))
        shutil.copy (os.path.join(self.build_dir, 'gas-preprocessor.pl'),
                     os.path.join(self.config.prefix, 'bin'))
        shell.call ('chmod +x %s' %
                os.path.join(self.config.prefix, 'bin', 'gas-preprocessor.pl'))
